package com.wu.creditmanager.entity;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import android.database.Cursor;

import com.wu.creditmanager.R;

public class Bank implements Serializable {

	private static final long serialVersionUID = 5329993439818482680L;

	public static final String TBL_NAME = "tbl_banks";

	public static final String NAME = "name";
	public static final String DEFAULT_ICON = "default_icon";
	public static final String HOTLINE = "hotline";
	public static final String SMS_NUMBER = "sms_number";

	private static Map<String, Integer> iconMap = new HashMap<String, Integer>();
	static {
		iconMap.put("abc", R.drawable.abc);
		iconMap.put("bcm", R.drawable.bcm);
		iconMap.put("bob", R.drawable.bob);
		iconMap.put("boc", R.drawable.boc);
		iconMap.put("bos", R.drawable.bos);
		iconMap.put("ccb", R.drawable.ccb);
		iconMap.put("ceb", R.drawable.ceb);
		iconMap.put("cib", R.drawable.cib);
		iconMap.put("citic", R.drawable.citic);
		iconMap.put("cmb", R.drawable.cmb);
		iconMap.put("cmbc", R.drawable.cmbc);
		iconMap.put("gdb", R.drawable.gdb);
		iconMap.put("hxb", R.drawable.hxb);
		iconMap.put("icbc", R.drawable.icbc);
		iconMap.put("pab", R.drawable.pab);
		iconMap.put("sdb", R.drawable.sdb);
		iconMap.put("spdb", R.drawable.spdb);
	}

	private long id;

	private String name;

	private String defaultIcon;

	private String hotline;

	private String smsNumber;

	public String getHotline() {
		return hotline;
	}

	public void setHotline(String hotline) {
		this.hotline = hotline;
	}

	public String getSmsNumber() {
		return smsNumber;
	}

	public void setSmsNumber(String smsNumber) {
		this.smsNumber = smsNumber;
	}

	public Bank() {
	}

	public Bank(long id) {
		this.id = id;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDefaultIcon() {
		return defaultIcon;
	}

	public int getIconResId() {
		Integer icon = iconMap.get(this.defaultIcon);
		return icon == null ? R.drawable.icon : icon;

	}

	public void setDefaultIcon(String defaultIcon) {
		this.defaultIcon = defaultIcon;

	}

	public void initValue(Cursor cursor, int start) {

	}
}
